<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>dps.x509Certificate.X509Certificate</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://code.google.com/p/dps-x509/">DPS</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        <a href="dps-module.html">Package&nbsp;dps</a> ::
        <a href="dps.x509Certificate-module.html">Module&nbsp;x509Certificate</a> ::
        Class&nbsp;X509Certificate
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[show&nbsp;private&nbsp;|&nbsp;<a href="../public/dps.x509Certificate.X509Certificate-class.html">hide&nbsp;private</a>]</font></td></tr>
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="dps.x509Certificate.X509Certificate-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF CLASS DESCRIPTION =========== -->
<h2 class="class">Class X509Certificate</h2>

<hr/>

Class that provides facade to keyzcar.utils functionality.
<hr/>


<!-- =========== START OF METHOD SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Method Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>extractor</span>,
          <span class=summary-sig-arg>privateKey</span>)</span></code>
<br />
constructor</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        string
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#asBase64" class="summary-sig-name"><code>asBase64</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
base64 representation without header and footer</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        bool
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#autoVerifySignature" class="summary-sig-name"><code>autoVerifySignature</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
check if this certificate was tampered with.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        bool
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#eq" class="summary-sig-name"><code>eq</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>other</span>)</span></code>
<br />
equals operator.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        string
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#getIssuerAsBase64" class="summary-sig-name"><code>getIssuerAsBase64</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
returns issuer info</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        keyczar.keys.RsaPublicKey
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#getIssuerPublicKey" class="summary-sig-name"><code>getIssuerPublicKey</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
gets the public key used to issue this cert or None if it can't be 
found</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        dps.x509CertificateParams.X509CertificateParams
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#getParams" class="summary-sig-name"><code>getParams</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
get the properties out of this certificate</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        string
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#getSubjectAsBase64" class="summary-sig-name"><code>getSubjectAsBase64</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
returns subject info</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        bool
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#isSelfSigned" class="summary-sig-name"><code>isSelfSigned</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
if it has an issuer and subject are the same it is not self signed</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        X509Certificate
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#load" class="summary-sig-name"><code>load</code></a>(<span class=summary-sig-arg>certificate</span>,
          <span class=summary-sig-arg>privateKey</span>)</span></code>
<br />
load a certificate from string file contents    <i>(Static method)</i>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        bool
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#ne" class="summary-sig-name"><code>ne</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>other</span>)</span></code>
<br />
not equals operator.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        string
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#prettyPrint" class="summary-sig-name"><code>prettyPrint</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
returns string from asn1 pretty print</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        keyczar.keys.RSAPrivateKey. this may be none
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#privateKey" class="summary-sig-name"><code>privateKey</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#setIssuerCertificate" class="summary-sig-name"><code>setIssuerCertificate</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>issuerCertificate</span>)</span></code>
<br />
sets the certificate that was used to sign this one</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        bool
</font></td>
  <td><code><span class="summary-sig"><a href="dps.x509Certificate.X509Certificate-class.html#verifySignature" class="summary-sig-name"><code>verifySignature</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>rsaPubKey</span>)</span></code>
<br />
check if the public key can be used to verify the certificate</td></tr>
</table><br />


<!-- =========== START OF INSTANCE METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Instance Method Details</th></tr>
</table>

<a name="__init__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>extractor</span>,
          <span class=sig-arg>privateKey</span>=<span class=sig-default>None</span>)</span>
    <br /><i>(Constructor)</i>
  </h3>
  constructor
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>extractor</b></code> -
         that interfaces with asn1
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=dps.x509Extractor)</i>
      <dd><code><b>privateKey</b></code> -
         if None this will be generated for you
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=keyczar.keys.RSAPrivateKey)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="asBase64"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">asBase64</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  base64 representation without header and footer
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        string
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="autoVerifySignature"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">autoVerifySignature</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  check if this certificate was tampered with. if issuer certificate 
  is null the certificate is assumed to be self signed so this 
  certificates public key is used for verification. otherwise the issuer 
  certificates public key is used
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        true if the certificate is verifed by the public key
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=bool)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="eq"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">eq</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>other</span>)</span>
  </h3>
  equals operator. compares base 64 output
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        bool
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getIssuerAsBase64"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getIssuerAsBase64</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  returns issuer info
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        string
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getIssuerPublicKey"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getIssuerPublicKey</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  gets the public key used to issue this cert or None if it can't be 
  found
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        keyczar.keys.RsaPublicKey
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getParams"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getParams</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  get the properties out of this certificate
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        dps.x509CertificateParams.X509CertificateParams
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getSubjectAsBase64"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getSubjectAsBase64</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  returns subject info
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        string
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="isSelfSigned"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">isSelfSigned</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  if it has an issuer and subject are the same it is not self 
  signed
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        bool
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="ne"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">ne</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>other</span>)</span>
  </h3>
  not equals operator. compares base 64 output
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        bool
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="prettyPrint"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">prettyPrint</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  returns string from asn1 pretty print
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        string
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="privateKey"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">privateKey</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        keyczar.keys.RSAPrivateKey. this may be none
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="setIssuerCertificate"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">setIssuerCertificate</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>issuerCertificate</span>)</span>
  </h3>
  sets the certificate that was used to sign this one
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>issuerCertificate</b></code> -
         issuer certificate
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=dps.x509Certificate.X509Certificate)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="verifySignature"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">verifySignature</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>rsaPubKey</span>)</span>
  </h3>
  check if the public key can be used to verify the certificate
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>rsaPubKey</b></code>
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=keyczar.keys.RsaPublicKey)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        true if the certificate is verifed by the public key
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=bool)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF STATIC METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Static Method Details</th></tr>
</table>

<a name="load"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">load</span>(<span class=sig-arg>certificate</span>,
          <span class=sig-arg>privateKey</span>=<span class=sig-default>None</span>)</span>
  </h3>
  load a certificate from string file contents
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>certificate</b></code> -
         certificate to load in der or base64 string formats
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=string)</i>
      <dd><code><b>privateKey</b></code> -
         if None this will be generated for you
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=keyczar.keys.RSAPrivateKey)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        X509Certificate
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>dps.errors.MissingRequiredParametersError</b></code> -
        if required fields are missing. ie. token value, token type 
        See http://code.google.com/p/dps-x509/wiki/ValueTokenDefinitions 
        for more information
      <dd><code><b>dps.errors.NoRSADataFoundError</b></code> -
        if dsa or other pki algorithm is used. RSA is currently the 
        only supported.
      <dd><code><b>dps.errors.InvalidSignatureError</b></code> -
        if the signature does not match the certificate
      <dd><code><b>dps.errors.DecodingError</b></code> -
        if otherwise unable to create asn1 model from cert
    </dl>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://code.google.com/p/dps-x509/">DPS</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Sun Oct 24 22:24:02 2010</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
